﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Quote.aspx.cs" Inherits="Quote"
    EnableEventValidation="true" Async="true" MasterPageFile="~/Mobile.master" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/controls/urlLanguage.ascx" TagName="usrLanguage" TagPrefix="uc1" %>
<%@ Register Src="~/controls/usrDate.ascx" TagName="usrDate" TagPrefix="uc2" %>
<%@ Register Src="~/controls/usrOccupation.ascx" TagName="usrOccupation" TagPrefix="uc3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <form id="Form1" runat="server">
    <section>
<header id="header">
<nav id="nav">
<a href="default.aspx"><div class="branding"></div></a>
<div class="nav">
<a href="default.aspx">
<asp:Image ID="imgTop" runat="server" ImageUrl="<%$Resources:CarInsurance,TopNavBack%>" Width="49" Height="29" AlternateText="Start" BorderWidth="0" />
</a>
</div>
</nav>
</header>
</section>
    <section id="body">
<div class="body">
<asp:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server">
    </asp:ScriptManager>

<br/>
<div class="form">

<asp:Image ID="imgHeader" runat="server" ImageUrl="<%$Resources:CarInsurance,QuoteHeader%>" Height="58px" BorderWidth="0" />
 <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="uplCarYear">
            <ProgressTemplate>
            <div style="position:absolute; width: 270px; height: 670px; background-color: Gray; filter: alpha(opacity=90); opacity: 0.8; ">
                <img alt="" src="images/loader/loader_main.gif" style="margin-top: 400px;" />
                </div>
            </ProgressTemplate>
</asp:UpdateProgress>
  <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="uplCarMake">
            <ProgressTemplate>
            <div style="position:absolute; width: 270px; height: 670px; background-color: Gray; filter: alpha(opacity=90); opacity: 0.8; ">
                <img alt="" src="images/loader/loader_main.gif" style="margin-top: 440px;"/>
                </div>
            </ProgressTemplate>
</asp:UpdateProgress>
  <asp:UpdateProgress ID="UpdateProgress3" runat="server" AssociatedUpdatePanelID="uplCarModel">
            <ProgressTemplate>
            <div style="position:absolute; width: 270px; height: 670px; background-color: Gray; filter: alpha(opacity=90); opacity: 0.8; ">
                <img alt="" src="images/loader/loader_main.gif" style="margin-top: 470px;"/>
                </div>
            </ProgressTemplate>
</asp:UpdateProgress>
<div class="pad">
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="carquote" ShowSummary="True" CssClass="errorSummary" >
</asp:ValidationSummary>
<div style="display:none;">
<asp:TextBox ID="txtName" runat="server" Text="<%$Resources:CarInsurance,YourName%>" CssClass="input" Width="220px" ></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvName" ControlToValidate="txtName" runat="server" InitialValue="Your name ..."
 ValidationGroup="carquote" Display="Dynamic" CssClass="validationErrorControl" Enabled="false" ErrorMessage=""></asp:RequiredFieldValidator>
<br /></div>
<asp:TextBox ID="txtFirstName" runat="server" Text="<%$Resources:CarInsurance,YourName%>" CssClass="input" Width="220px" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtFirstName" runat="server" InitialValue="Your name ..."
 ValidationGroup="carquote" Display="Dynamic" CssClass="validationErrorControl" Enabled="false" ErrorMessage=""></asp:RequiredFieldValidator>
<br />

<html5:emailinput ID="txtEmail" runat="server" Text="<%$Resources:CarInsurance,YourEmail%>" CssClass="input" Width="220px">
    </html5:emailinput>
<asp:RequiredFieldValidator ID="rfvtxtEmail" ControlToValidate="txtEmail" runat="server" 
 ValidationGroup="carquote" Display="Dynamic" CssClass="validationErrorControl" ErrorMessage=""></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="rfvEmailValid" Text="" CssClass="validationErrorControl" runat="server" ValidationGroup="carquote" ControlToValidate="txtEmail"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Display="Dynamic" ErrorMessage=""></asp:RegularExpressionValidator><br/>

<div id="divEmail" runat="server" visible="false">
<small><font color="red">Email already exists</font></small>
</div>
 <asp:DropDownList ID="ddlMobile" runat="server"  ToolTip ="Mobile No" Width="70" CssClass="input" >
        <asp:ListItem Text="<%$Resources:CarInsurance,Select%>" Value="-1" />
        <asp:ListItem Text="080" Value="080" />
        <asp:ListItem Text="081" Value="081" />
        <asp:ListItem Text="082" Value="082" />
        <asp:ListItem Text="083" Value="083" />
        <asp:ListItem Text="084" Value="084" />
        <asp:ListItem Text="085" Value="085" />
        <asp:ListItem Text="086" Value="086" />
        <asp:ListItem Text="087" Value="087" />
        <asp:ListItem Text="088" Value="088" />
        <asp:ListItem Text="089" Value="089" />
        <asp:ListItem Text="090" Value="090" />
        <asp:ListItem Text="091" Value="091" />
        <asp:ListItem Text="092" Value="092" />
        <asp:ListItem Text="093" Value="093" />
        <asp:ListItem Text="094" Value="094" />
        <asp:ListItem Text="095" Value="095" />
        <asp:ListItem Text="096" Value="096" />
        <asp:ListItem Text="097" Value="097" />
        <asp:ListItem Text="098" Value="098" />
        <asp:ListItem Text="099" Value="099" />  
    </asp:DropDownList>
    <asp:RequiredFieldValidator ID="rfvMobile" ControlToValidate="ddlMobile" runat="server" InitialValue="-1"
 ValidationGroup="carquote" Display="Dynamic" CssClass="validationErrorControl" ErrorMessage=""></asp:RequiredFieldValidator>
<html5:PhoneInput ID="txtPhoneNum"
    Text="<%$Resources:CarInsurance,YourPhone%>" CssClass="input" Width="135px" MaxLength="7" ToolTip="Enter 7 digits phone number." runat="server">
    </html5:PhoneInput>
<asp:RequiredFieldValidator ID="rfvtxtPhoneNum" ControlToValidate="txtPhoneNum" runat="server" 
 ValidationGroup="carquote" Display="Dynamic" CssClass="validationErrorControl" ErrorMessage=""></asp:RequiredFieldValidator><br/>
<asp:RegularExpressionValidator CssClass="validationErrorControl" ID="revPhoneNo" ValidationGroup="carquote"
        runat="server" ValidationExpression="[0-9]{7}" ControlToValidate="txtPhoneNum"
        ErrorMessage="" Text="" Display="Dynamic" ></asp:RegularExpressionValidator>
        
<asp:UpdatePanel ID="uplCarYear" runat="server">
<ContentTemplate>        
<asp:DropDownList ID="ddlCarYear" runat="server" Width="233px" CssClass="input" AutoPostBack="True" OnSelectedIndexChanged="ddlCarYear_SelectedIndexChanged">
<asp:ListItem Text="<%$Resources:CarInsurance,SelectCarYear%>" Value="-1">
</asp:ListItem> 
</asp:DropDownList>
<asp:RequiredFieldValidator ID="rfvCarYear" ControlToValidate="ddlCarYear" InitialValue="-1" runat="server" 
 ErrorMessage="" Text="" ValidationGroup="carquote" Display="Dynamic" CssClass="validationErrorControl"></asp:RequiredFieldValidator>
 </ContentTemplate>
 </asp:UpdatePanel>

<asp:UpdatePanel ID="uplCarMake" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlCarMake" runat="server" Width="233px" CssClass="input" AutoPostBack="true" OnSelectedIndexChanged="ddlCarMake_SelectedIndexChanged">
<asp:ListItem Text="<%$Resources:CarInsurance,SelectCarMake%>" Value="-1">
</asp:ListItem>
</asp:DropDownList>
 <asp:RequiredFieldValidator ID="rfvCarMake" ControlToValidate="ddlCarMake" InitialValue="-1" runat="server" 
 ValidationGroup="carquote" Display="Dynamic" CssClass="validationErrorControl" ErrorMessage=""></asp:RequiredFieldValidator>
 </ContentTemplate>
 </asp:UpdatePanel>

<asp:UpdatePanel ID="uplCarModel" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlCarModel" runat="server" Width="233px" CssClass="input" AutoPostBack="true" OnSelectedIndexChanged="ddlCarModel_SelectedIndexChanged">
<asp:ListItem Text="<%$Resources:CarInsurance,SelectCarModel%>" Value="-1">
</asp:ListItem>
</asp:DropDownList>
 <asp:RequiredFieldValidator ID="rfvCarModel" ControlToValidate="ddlCarModel" InitialValue="-1" runat="server" 
 ValidationGroup="carquote" Display="Dynamic" CssClass="validationErrorControl" ErrorMessage=""></asp:RequiredFieldValidator>
 
</ContentTemplate>
</asp:UpdatePanel>
<asp:Label runat="server" ID="lblSumInsured" Text="0" Visible="false" />
  <asp:Label runat="server" ID="lblCarVehicleType" Text="" Visible="false" />
   <div style="display: none">
    <asp:TextBox ID="txtSumInsured" MaxLength="9" Width="80px" Text="0" runat="server" />
    <asp:TextBox ID="txtNewSumInsured" MaxLength="9" Width="80px" runat="server" />
    <asp:TextBox ID="txtGroupNo" Text="-1" MaxLength="2" Width="30px" runat="server" />
     <asp:DropDownList ID="ddlVehicleType" runat="server" >
                                                        <asp:ListItem Value="110" Text="<%$ Resources:CarInsurance,VehicleType_Private%>" />
                                                    </asp:DropDownList>
   </div>
<asp:UpdatePanel ID="uplCoverageComDate" runat="server">
<ContentTemplate>
<asp:DropDownList ID="ddlCoverageComDate" CssClass="input" runat="server" Width="75">
</asp:DropDownList>&nbsp;
<asp:DropDownList ID="ddlCoverageComMonth" CssClass="input" runat="server" Width="140" AutoPostBack="true" OnSelectedIndexChanged="ddlCoverageComMonth_SelectedIndexChanged">
</asp:DropDownList>
<asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvCoverComDate"
    runat="server" InitialValue="-1" ControlToValidate="ddlCoverageComDate" ErrorMessage=""
    ValidationGroup="carquote" Display="Dynamic"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvCoverComMonth"
    runat="server" InitialValue="-1" ControlToValidate="ddlCoverageComMonth" ErrorMessage=""
    ValidationGroup="carquote" Display="Dynamic"></asp:RequiredFieldValidator>
</ContentTemplate>
</asp:UpdatePanel><br/>
<asp:Label ID="lblMessage" runat="server"></asp:Label>
<asp:Button ID="btnApply" runat="server" Width="250" Height="46" BorderWidth="0" ValidationGroup="carquote" OnClientClick="LoadValidationErrorCss()" onclick="btnApply_Click"  CssClass="<%$Resources:CarInsurance,QuoteNow%>" />
 <br/>
<hr />
</div>
<a href="tel:022688222" >
<asp:Image ID="imgCallHotline" runat="server" ImageUrl="<%$Resources:CarInsurance,ImageHotline%>" Width="220" AlternateText="Call us at 02 268 8222" BorderWidth="0" /></a><br />

<br/>

<section class="note">
<asp:Label ID="Label3" runat="server" Text="<%$ Resources:CarInsurance,ReadAbout%>" /> <asp:HyperLink ID="hlnkAboutUs" runat="server" Target="_blank" Text="GluayGluay.com" Visible="false"></asp:HyperLink>
</section>
</div>

<div class="bottom"></div>
</div>

<input id="inputLang" value="" style="display:none;" />
</div> 
</section>
    </form>

    <script type="text/javascript">
    <!--
        function RemoveSpace(c) {
            c.value = c.value.split(' ').join('')
        }

        function PhoneNoLengthClientValidate(source, arguments) {
            if (arguments.Value.length != 0 && arguments.Value.length < 9) {
                arguments.IsValid = false;
            } else {
                arguments.IsValid = true;
            }
        }

        function CheckPhoneNoClientValidate(source, arguments) {
            var cval = parseInt(arguments.Value)
            if (isNaN(cval)) {
                arguments.IsValid = false;
            } else {
                var cstrVal = "" + cval + "";
                if (cstrVal.length < 8) {
                    arguments.IsValid = false;
                }
                else if (cstrVal.charAt(0) != "6" &&
                    cstrVal.charAt(0) != "8" &&
                    cstrVal.charAt(0) != "9") {
                    arguments.IsValid = false;
                }
                else {
                    arguments.IsValid = true;
                }
            }
        }

        function DefaultFirstName(TextBoxControl, TextBoxEvent) {
            if (TextBoxControl.value.length == 0 && TextBoxEvent.type == "blur") {
                if (document.getElementById('inputLang').value == 'EN') {
                    TextBoxControl.value = "Your name ...";
                }
                else {
                    TextBoxControl.value = "ชื่อ";
                }

            }
            //alert("default first name.");
        }

        function DefaultLastName(TextBoxControl, TextBoxEvent) {
            if (TextBoxControl.value.length == 0 && TextBoxEvent.type == "blur") {
                if (document.getElementById('inputLang').value == 'EN') {
                    TextBoxControl.value = "Your last name ...";
                }

            }
            //alert("default last name.");
        }
 
        function DefaultEmail(TextBoxControl, TextBoxEvent) {
            if (TextBoxControl.value.length == 0 && TextBoxEvent.type == "blur") {
                if (document.getElementById('inputLang').value == 'EN') {
                    TextBoxControl.value = "Your E-mail address ...";
                }
                else {
                    TextBoxControl.value = "อีเมล์";
                }

            }
            //alert("default email.");
        }

        function DefaultPhone(TextBoxControl, TextBoxEvent) {
            if (TextBoxControl.value.length == 0 && TextBoxEvent.type == "blur") {
                if (document.getElementById('inputLang').value == 'EN') {
                    TextBoxControl.value = "Your Phone number ...";
                }
                else {
                    TextBoxControl.value = "เบอร์โทรศัพท์";
                }
            }
            //alert("default phone.");
        }

        function ClearText(TextBoxControl, TextBoxEvent) {
            if (TextBoxControl.value == "Your name ...") {
                TextBoxControl.value = "";
                document.getElementById('inputLang').value = 'EN'
            }
            if (TextBoxControl.value == "ชื่อ") {
                TextBoxControl.value = "";
                document.getElementById('inputLang').value = 'TH'
            }
            if (TextBoxControl.value == "Your E-mail address ...") {
                TextBoxControl.value = "";
                document.getElementById('inputLang').value = 'EN'
            }

            if (TextBoxControl.value == "อีเมล์") {
                TextBoxControl.value = "";
                document.getElementById('inputLang').value = 'TH'
            }
            if (TextBoxControl.value == "Your Phone number ...") {
                TextBoxControl.value = "";
                document.getElementById('inputLang').value = 'EN'
            }
            if (TextBoxControl.value == "เบอร์โทรศัพท์") {
                TextBoxControl.value = "";
                document.getElementById('inputLang').value = 'TH'
            }
        }

        function ShowPopup() {
            var modpop = $find("mdlPopupPassword");
            if (!modpop) { return; }
            modpop.show()
        }

        function HidePopup() {
            var modpop = $find("mdlPopupPassword");

            if (!modpop) { return; }
            modpop.hide()
        }
        
    //-->
    </script>

</asp:Content>
